﻿Feature: Collections
	As a component in a system that consumes the Patterns library,
	I want to be able to manipulate collections of different types
	without having to wrap or cast the collection first.

Scenario: Add Range
	Given I have created a new collection containing 2 new complex test objects
	When I add 4 new complex test objects using the AddRange method
	Then the collection count should equal 6

Scenario: Get Missing Value
	Given I have created a new dictionary containing 0 new complex test objects
	When I attempt to get a value from the dictionary at key "key1"
	Then the result should be null

Scenario: Get Existing Value
	Given I have created a new dictionary containing 1 new complex test object at key "key1"
	When I attempt to get a value from the dictionary at key "key1"
	Then the test object and the retrieved object should be the same

Scenario: Property Bags
	Given I have created a complex test object
	When I convert the object to a property bag
	Then all of the test object's properties should be the same as the property bag's values

Scenario: For each (lambda syntax, serial)
	Given I have created a new collection containing 2 new complex test objects
	And I have created a thread log dictionary for capturing thread Id and object hash code values
	When I add an entry to the thread log dictionary for each object in serial
	Then the thread log dictionary should have 1 thread
	And thread #1 should have 2 hash codes

Scenario: For each (lambda syntax, parallel)
	Given I have created a new collection containing 2 new complex test objects
	And I have created a thread log dictionary for capturing thread Id and object hash code values
	When I add an entry to the thread log dictionary for each object in parallel
	Then the thread log dictionary should have 2 threads
	And thread #1 should have 1 hash code
	And thread #2 should have 1 hash code